#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>

class RegionScene;
class MainWindowPrivate;
class MainWindow : public QMainWindow
{
	Q_OBJECT	
public:
	MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
	~MainWindow();
public:
	QUndoGroup* undoGroup() const;
	RegionScene* activeregionItemscene() const;
	QUndoStack* activeUndoStack() const;
	int maxRecentFiles() const;
	void setMaxRecentFiles(const int);
	QString currentFile() const;	
	void setCurrentFile(const QString &fileName);	
private slots:	// auto connect solts.
	void on_menuNew_triggered(QAction*);
	void on_actionNewScene_triggered();
	void on_actionNewFile_triggered();
	void on_actionOpen_triggered();
	void on_actionSave_triggered();
	void on_actionSaveAs_triggered(); 
	void on_actionImport_triggered();
	void on_actionExport_triggered();	
	void on_actionPreferences_triggered();
	void on_actionAbout_triggered();
	void on_actionGroup_triggered();
	void on_actionUngroup_triggered();
	void on_actionSendToBack_triggered();
	void on_actionBringToFront_triggered();
private slots: // custom slots.
	void openRecentFile();
	void regionActionTriggered(QAction*);
	void newMenuTriggered();
	void sceneActionTriggered(QAction*);
	void updateRegionActions();
	//void regionAdded(
private:       
	void setupMenuBar();
	void setupToolBar();
	void createRecentFileActions();
	void updateRecentFileActions();	    
	void loadFile(const QString &fileName);
	void saveFile(const QString &fileName);
	
protected:
	QScopedPointer<MainWindowPrivate> d_ptr;
private:
	Q_DECLARE_PRIVATE(MainWindow);
	Q_DISABLE_COPY(MainWindow);
};

#endif // MAINWINDOW_H
